package me.zhengjie.modules.system.domain;

import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import me.zhengjie.base.BaseEntity;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

import javax.persistence.*;
import javax.validation.constraints.NotNull;
import java.io.Serializable;

@Getter
@Setter
@Entity
@Table(name = "user_info")
@DynamicInsert
@DynamicUpdate
public class UserInfo extends BaseEntity implements Serializable {

    // 用戶ID
    @Id
    @Column(name = "user_id")
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @NotNull(groups = Update.class)
    private Integer userId;

    @Column(name = "user_info_type")
    @ApiModelProperty(value = "客户信息类型")
    private String userInfoType;

    // 类型总分占比
    @Column(name = "type_total_ratio")
    @ApiModelProperty(value = "类型总分占比")
    private String typeTotalRatio;
    // 客户信息属性
    @Column(name = "user_info_property")
    @ApiModelProperty(value = "客户信息属性")
    private String userInfoProperty;
    // 属性评分
    @Column(name = "property_score")
    @ApiModelProperty(value = "属性评分")
    private String propertyScore;
    // 评分说明
    @Column(name = "score_explain")
    @ApiModelProperty(value = "评分说明")
    private String scoreExplain;
    // 用户总分数
    @Column(name = "user_score")
    @ApiModelProperty(value = "用户总分数")
    private String userScore;

    @Column(name = "user_name")
    @ApiModelProperty(value = "用户名称")
    private String userName;

    @Column(name = "user_type")
    @ApiModelProperty(value = "用户类型")
    private String userType;

    @Column(name = "idNumber")
    @ApiModelProperty(value = "身份证号码")
    private String idNumber;

    @Column(name = "phone_code")
    @ApiModelProperty(value = "手机号码")
    private String phoneCode;

    @Column(name = "user_address")
    @ApiModelProperty(value = "用户地址")
    private String userAddress;

    @Column(name = "user_status", columnDefinition = "varchar(255) default '0'")
    @ApiModelProperty(value = "审核状态")
    private String userStatus;

    @Column(name = "contract_status", columnDefinition = "varchar(255) default '0'")
    @ApiModelProperty(value = "合同状态")
    private String contractStatus;
}
